﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="ContractRegister.aspx.cs" Inherits="ContractRegister" %>


<%@ Register assembly="obout_ComboBox" namespace="Obout.ComboBox" tagprefix="cc2" %>

<%@ Register assembly="Obout.Ajax.UI" namespace="Obout.Ajax.UI.FileUpload" tagprefix="obout" %>

<%@ Register assembly="obout_Calendar2_Net" namespace="OboutInc.Calendar2" tagprefix="obout" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%;">
        <tr>
            <td align="center" colspan="3" style="text-align: center;" valign="top">
                <asp:Label ID="Label1" runat="server" Text="NHẬP HỢP ĐỒNG MỚI " Font-Bold="True" 
                    Font-Size="Large"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label2" runat="server" Text="Số hợp đồng:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContNumber" runat="server" Width="264px"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtContNumber" CssClass="notification" 
                    ErrorMessage="Chưa nhập số hợp đồng" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label43" runat="server" Text="Ngày kí hợp đồng:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContDay" runat="server" Width="120px" Enabled="False"></asp:TextBox>
                <obout:Calendar ID="Calendar1" runat="server" 
                    DatePickerImagePath="Calenderstyles/date_picker1.gif" DatePickerMode="True" 
                    StyleFolder="Calenderstyles/style10" TextBoxId="txtContDay">
                </obout:Calendar>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" 
                    ControlToValidate="txtContDay" CssClass="notification" 
                    ErrorMessage="Chưa nhập ngày kí hợp đồng" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="lblContName" runat="server" Text="Tên khách hàng:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <cc2:ComboBox ID="cmbCusName" runat="server" AutoPostBack="True" 
                    LoadingText="đang tải ..." MenuWidth="80%" Width="60%" 
                    onselectedindexchanged="cmbCusName_SelectedIndexChanged">
                    <ItemTemplate>
                        <span class="template-name"><%# Eval("Name")%></span>
                        /
                        <span class="template-country">
                        <%# Eval("Telephone")%>
                        </span>
                    </ItemTemplate>
                </cc2:ComboBox>
                <cc2:ComboBox ID="cmbTutorName" runat="server" AutoPostBack="True" 
                    LoadingText="đang tải ..." MenuWidth="80%" Width="60%" 
                    onselectedindexchanged="cmbTutorName_SelectedIndexChanged">
                    <ItemTemplate>
                        <span><%# Eval("Name")%></span>
                        /
                        <span>
                        <%# Eval("Phone")%>
                        </span>
                    </ItemTemplate>
                </cc2:ComboBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:Label ID="lblContNameValid" runat="server" CssClass="notification" Font-Bold="True" 
                    ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <table style="width:100%;">
                    <tr>
                        <td style="width: 50%; text-align: right; vertical-align: top;" >
                            <table style="width:100%;">
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label26" runat="server" Text="Tên GS"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblTutorName" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label28" runat="server" Text="Mã GS:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblTutorID" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label29" runat="server" Text="Địa chỉ:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblTutorAdd" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label30" runat="server" Text="Số ĐT:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblTutorPhone" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%; text-align: left; vertical-align: top;">
                            <table style="width:100%;">
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label31" runat="server" Text="Tên KH"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblCusName" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label32" runat="server" Text="Mã KH:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblCusID" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label33" runat="server" Text="Địa chỉ:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblCusAdd" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 30%; text-align: right; vertical-align: top;">
                                        <asp:Label ID="Label34" runat="server" Text="Số ĐT:"></asp:Label>
                                    </td>
                                    <td style="text-align: left; vertical-align: top">
                                        <asp:Label ID="lblCusPhone" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label4" runat="server" Text="Địa chỉ dạy học:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContPlace" runat="server" TextMode="MultiLine" 
                    Width="264px" Rows="5"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:CheckBox ID="chkCusAdd" runat="server" AutoPostBack="True" 
                    oncheckedchanged="chkCusAdd_CheckedChanged" 
                    Text="Lấy thông tin địa chỉ khách hàng" />&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtContPlace" CssClass="notification" 
                    ErrorMessage="Chưa nhập địa chỉ" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br/>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label5" runat="server" Text="Môn học:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContSubj" runat="server" Width="264px" Rows="3" 
                    TextMode="MultiLine"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="txtContSubj" CssClass="notification" 
                    ErrorMessage="Chưa nhập môn học" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label35" runat="server" Text="Trình độ:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; " valign="top">
                <asp:TextBox ID="txtContClass" runat="server" Width="150px"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtContClass" CssClass="notification" 
                    ErrorMessage="Chưa nhập trình độ" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label46" runat="server" Text="Số lượng học sinh:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContPupil" runat="server" Width="52px"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtContPupil" CssClass="notification" 
                    ErrorMessage="Chưa nhập số lượng học sinh" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtContPupil" ErrorMessage="Nhập sai định dạng số" 
                    Font-Bold="True" ForeColor="Red" ValidationExpression="\d*" 
                    ValidationGroup="formCont" CssClass="notification"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label37" runat="server" Text="Học các ngày trong tuần:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContDate" runat="server" TextMode="MultiLine" 
                    Width="264px" Rows="3"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="txtContDate" CssClass="notification" 
                    ErrorMessage="Chưa nhập ngày học" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label38" runat="server" Text="Thời gian bắt đầu:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContStartHour" runat="server" Width="150px">00:00</asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="txtContStartHour" CssClass="notification" 
                    ErrorMessage="Chưa nhập thời gian bắt đầu buổi học" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtContPupil" ErrorMessage="Nhập sai định dạng thời gian" 
                    Font-Bold="True" ForeColor="Red" ValidationExpression="^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$" 
                    ValidationGroup="formCont" CssClass="notification"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label39" runat="server" Text="Thời gian kết thúc:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContEndHour" runat="server" Width="150px">00:00</asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ControlToValidate="txtContEndHour" CssClass="notification" 
                    ErrorMessage="Chưa nhập thời gian kết thúc buổi học" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ControlToValidate="txtContPupil" ErrorMessage="Nhập sai định dạng thời gian" 
                    Font-Bold="True" ForeColor="Red" ValidationExpression="^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$" 
                    ValidationGroup="formCont" CssClass="notification"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label40" runat="server" Text="Mức thù lao:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtContPrice" runat="server" Width="150px"></asp:TextBox>
                <asp:Label ID="Label23" runat="server" Text="x1000vnđ/1 buổi"></asp:Label>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                    ControlToValidate="txtContPrice" CssClass="notification" 
                    ErrorMessage="Chưa nhập mức thù lao" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                    ControlToValidate="txtContPrice" ErrorMessage="Nhập sai định dạng tiền" 
                    Font-Bold="True" ForeColor="Red" ValidationExpression="(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)" 
                    ValidationGroup="formCont" CssClass="notification"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label41" runat="server" Text="Trả tiền lần 1:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtFirstPaid" runat="server" Width="150px"></asp:TextBox>
                <asp:Label ID="Label50" runat="server" Text="x1000vnđ"></asp:Label>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                    ControlToValidate="txtFirstPaid" CssClass="notification" 
                    ErrorMessage="Chưa nhập số tiền trả đợt 1" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="txtFirstPaid" ErrorMessage="Nhập sai định dạng tiền" 
                    Font-Bold="True" ForeColor="Red" ValidationExpression="(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)" 
                    ValidationGroup="formCont" CssClass="notification"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label48" runat="server" Text="Trạng thái:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:DropDownList ID="drIsPaid" class="dr" runat="server" Width="125px">
                    <asp:ListItem Selected="True" Value="false">Chưa thanh toán</asp:ListItem>
                    <asp:ListItem Value="true">Đã thanh toán</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label44" runat="server" Text="Ngày bắt đầu dạy:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtStartDate" runat="server" Width="124px" Enabled="False"></asp:TextBox>
                <obout:Calendar ID="Calendar2" runat="server" 
                    DatePickerImagePath="Calenderstyles/date_picker1.gif" DatePickerMode="True" 
                    StyleFolder="Calenderstyles/style10" TextBoxId="txtStartDate">
                </obout:Calendar>
                </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" 
                    ControlToValidate="txtStartDate" CssClass="notification" 
                    ErrorMessage="Chưa nhập ngày bắt đầu dạy" Font-Bold="True" ForeColor="Red" 
                    ValidationGroup="formCont"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label20" runat="server" Text="File hợp đồng:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:FileUpload ID="FileUpload1" runat="server" Width="100%" />
                <asp:Label ID="lblFileName" runat="server"></asp:Label>
                &nbsp;&nbsp;<br /><br />
                <asp:Button ID="btnUpload" class="button" runat="server" Text="Tải lên" 
                    onclick="btnUpload_Click" Width="65px" />
                &nbsp 
                <asp:Button ID="btnChange" class="button" runat="server" Text="Thay đổi" 
                    onclick="btnChange_Click" Width="65px" />
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                <asp:Label ID="lblFileValid" runat="server" Font-Bold="True" CssClass="notification" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label45" runat="server" Text="Điểm hiện tại của học sinh:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtCurMark" runat="server" TextMode="MultiLine" 
                    Width="264px" Rows="3"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                <asp:Label ID="Label47" runat="server" Text="Điểm mong muốn:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; ">
                <asp:TextBox ID="txtExpMark" runat="server" TextMode="MultiLine" 
                    Width="264px" Rows="3"></asp:TextBox>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top; height: 50px;">
                <asp:Label ID="Label49" runat="server" Text="Tình trạng hợp đồng:"></asp:Label>
            </td>
            <td style="vertical-align: top; text-align: left; height: 50px;">
                <asp:DropDownList ID="drContStatus" class="dr" runat="server" Width="115px">
                    <asp:ListItem Selected="True" Value="Đang chờ">Đang chờ</asp:ListItem>
                    <asp:ListItem Value="Đang dạy">Đang dạy</asp:ListItem>
                    <asp:ListItem>Đã chấm dứt</asp:ListItem>
                    <asp:ListItem>Đổi gia sư</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td style="text-align: left; width: 30%; vertical-align: top; height: 50px;">
                </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 30%; vertical-align: top;">
                &nbsp;</td>
            <td>
                <asp:Button ID="Submit" class=button runat="server" Text="Hoàn thành" 
                    Width="80px" ValidationGroup="formCont" onclick="Submit_Click" />
                &nbsp
                <asp:Button ID="Reset" class=button runat="server" Text="Nhập lại" Width="65px" 
                    onclick="Reset_Click"  />
            </td>
            <td style="text-align: left; width: 20%">
                &nbsp;</td>
        </tr>
    </table> 
</asp:Content>

